1. Field of Invention
This invention generally relates to processing an image. More particularly, this invention is directed to methods and systems that use a median filter to sharpen the edges of objects within an image.
2. Description of Related Art
Imaging devices generally use an electronic sensing device to capture images. Examples of electronic sensing devices include scanners, electrophotographic and videographic devices and medical imaging devices such as x-ray, catscan, NMR and the like. The images can be captured directly from an object, or indirectly from a medium, such as film. The electronic image data is organized and stored as a plurality of pixels which together make up a representation of an entire image. Each pixel is generally represented as one or more bits, such as a byte, of image data defining an image value for that pixel. The image value of each pixel represents a different color or the densities of one or more different colors, or, in a black and white system, a density ranging from black to white.
During capturing and storing an image, inaccurate or imprecise image values are often generated for various pixels within the image. This is particularly a problem around the edges of objects within images. In some edge lines, where there should be a dramatic difference between the image values for pixels on different sides of the edge, soft or blurred edges often occur. An edge can appear soft or blurred for several reasons, including poor focus, movement of the sensing device or of the object (or objects) being sensed, or the physical limitations of the sensing device. On a soft edge, the image color or intensity does not change abruptly from one pixel to the adjacent pixel, but rather shows up as incremental changes over several pixels.
The appearance of an image can often be improved by sharpening the edges of objects within the image. A conventional technique for image sharpening increases the high frequency components of the image through some type of feedback mechanism. This may be accomplished by a convolution with an edge enhancing filter or, alternatively and more efficiently, using error-diffusion techniques.
Median filters are commonly used to filter signals. xe2x80x9cThe Weighted Median Filterxe2x80x9d, D. R. K. Brownrigg, Image Processing and Computer Vision, R. Haralick, ed., Association for Computing Machinery, (1984) and xe2x80x9cAdaptive Decimated Median Filteringxe2x80x9d, Lale Akurun et al., Pattern Recognition Letters 13, pp 57-62, January 1992, each incorporated herein by reference in its entirety, describe some applications of median filtering.
The conventional approaches to image sharpening have several limitations. The finite-sized filter that is often used may cause an over-compensation and xe2x80x9cringingxe2x80x9d at the edge. This ringing is schematically illustrated in FIGS. 1-3. FIG. 1 illustrates the image values for eight adjacent pixels. The pixels may be vertically, horizontally or diagonally adjacent. The image values shown in FIG. 1 represent the color and/or intensity of each of the eight pixels for the xe2x80x9ctruexe2x80x9d image. The xe2x80x9ctruexe2x80x9d image has an edge between the fourth and fifth pixels. This is represented by the sharp numerical drop in the image values between the first four pixels, which may all be at one color or density, and the last four pixels, which are at a different color or density. However, because a conventional sensing device is often not sensitive enough to record such a sharp change, or because the sharp change is not accurately recorded for some other reason, a soft and/or blurred image edge occurs in the recorded image. For the soft and/or blurred image, the image values for the eight pixels do not change abruptly from one pixel to the next, as in FIG. 1, but, instead, change incrementally over several pixels. In the example illustrated in FIG. 2, for the eight pixels having the xe2x80x9ctruexe2x80x9d image values shown in FIG. 1, the image values actually recorded and stored for these eight pixels change incrementally over the eight pixels.
FIG. 3 illustrates the over-compensation and xe2x80x9cringingxe2x80x9d that occurs in the image values of these eight pixels at the edge of an object when using a conventional finite-sized filter to sharpen the image.
Also, due to noise, a sensing device occasionally incorrectly records a xe2x80x9cbadxe2x80x9d image value for one or more pixels. FIG. 4 illustrates the image values for another set of nine pixels, where the image value for the fifth pixel value contains noise. Noise may be incidentally recorded anywhere in the image. Using one of the conventional sharpening techniques, the noise may actually be enhanced. This is illustrated in FIG. 5, which shows the image values for the nine pixels shown in FIG. 4 after the portion of the image they represent has been sharpened by one of the conventional sharpening techniques.
FIG. 6 shows an unenhanced image that has been captured, stored and printed using conventional techniques. FIG. 7 shows an enlarged portion of the unenhanced conventional image of FIG. 6 showing in detail a recorded soft edge. FIG. 8 shows an image similar to that of FIG. 6 after being enhanced using a conventional enhancing image. FIG. 9 is an enlarged portion of the conventionally enhanced image of FIG. 8, showing the xe2x80x9cringingxe2x80x9d at the edge and the enhanced noise, which is located both nearby and away from the edge.
This invention provides systems and methods that improve images without creating ringing artifacts or enhancing noise.
This invention separately provides methods and systems that use a median filtering to improve images without creating ringing artifacts or enhancing noise.
This invention separately provides systems and methods that improve the sharpness of an image by sharpening edges in the image.
This invention separately provides methods and systems in which the median filtering is accomplished by estimating an image value for a selected target pixel by taking the median of the image value measured for the specified target pixel, and of a first image value predicted from the image values of pixels on one side of the selected target pixel and a second image value predicted from the image values of pixels on an opposite side of the selected target pixel.
One exemplary embodiment of the median filter image sharpening methods and systems of this invention includes an image storing device that stores at least some of the image as a plurality of pixels. The median filter compares the measured image value for one of the pixels with image values determined from the image values of neighboring pixels. The filter considers image values from some or all of the eight immediately adjacent pixels (left, right, above, below, diagonal above left, diagonal above right, diagonal below left and diagonal below right), and also of the image values of one or more pixels immediately-adjacent or near to the eight immediately adjacent pixels.
In one exemplary embodiment of the image sharpening methods and systems of this invention, an original image value for a selected target pixel is compared with a first calculated image value determined from, for example, the image values of the two pixels directly to the left of the selected target pixel and the image values for the two pixels directly to the right of the selected target pixel. The median of the three pixels"" image values is selected to replace the original image value for the target pixel. This process is repeated for each pixel. Alternatively, this process is repeated for a representative number of pixels. The process can also be repeated using the image values for pixels above and below a selected target pixel, and also for the image values for pixels diagonally adjacent to the selected target pixel. Alternatively, rather than comparing the image value of the selected target pixel individually with the image values of one or more of the vertically, horizontally and diagonally neighboring pixels, a determination based on the image values for all eight of the neighboring pixels, and the image values of pixels that neighbor those eight can be used at the same time.
In another exemplary embodiment of the image sharpening methods and systems of this invention, the image values used to determine the median image value used to replace the image value for the selected target pixel also include the original image values for the adjacent pixels. Thus, if the image value for the horizontally adjacent pixels are used, the replacement image value for the target pixel will be the median of the original image value for the selected target pixel, the image values interpolated from the pixels to the left and right of the target pixel and the original image values of the left and right adjacent pixels. Again, the process can be repeated for vertically and diagonally adjacent pixels, and the process can alternatively be done with all of the neighboring pixels at one time.
These and other features and advantages of this invention are described in or are apparent from the following detailed description of the preferred embodiments.